<?php
/**
 * This class is to initiate the Zend_View object used in Front end
 * 
 * @package Front_Library
 * @version $Id:$
 */
class Front_Library_View
{
    /**
	 * @var Zend_View
	 */
    public $view;
	
    /**
	 * Constructor
	 * 
	 * @param Zend_View $view
	 */
	public function __construct($view)
	{
		$this->view = $view;
	}
	
	/**
	 * Constructor extension
	 * 
	 * @return Zend_View
	 */
	public function init()
	{
	    //$this->view->addFilterPath('Custom/View/Filter', 'Custom_View_Filter');
        //$this->view->setFilter('Translate');
        
    	// set encoding and doctype
		$this->view->setEncoding('UTF-8');

		$this->view->doctype('XHTML1_STRICT');

		// set the content type and language
		$this->view->headMeta()
			       ->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8');
		
		$this->view->headMeta()
				   ->appendHttpEquiv('Content-Language', 'en-US');

		// setting the site in the title
		$title = "Website for Hidge project";
		$this->view->title = $title;
		
		// set the copyright
		$copyright = "Hidge project copyright";
        $this->view->headMeta($copyright, 'copyright');
        
		// attach default CSS to front-pages
		$this->view->headLink()->appendStylesheet($this->view->baseUrl() . '/css/layout.css');
		//$this->view->headLink()->appendStylesheet($this->view->baseUrl() . '/css/style_ie.css', 'all', 'IE 7');

		// attach favicon
		$this->view->headLink(
            array(
            	'rel'  => 'short icon',
                'href' => $this->view->baseUrl() . '/img/favicon.ico',
                'type' => 'image/x-icon'
            )
        );
		
		return $this->view;
	}
}